package com.itnoob.demo1;

/**
 * 内部不变的状态
 * @author zhoujun
 * @date 2025/3/21 21:46
 */
public class ConcreteCoffee implements Coffee {

    private  final  String name;

    private  final  double price;


    public ConcreteCoffee(String name, double price) {
        this.name = name;
        this.price = price;

        System.out.println("创建了"+name + "实例");
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public double getPrice() {
        return price;
    }

    @Override
    public void disPlay() {
        System.out.println("Coffee:" + name + ",Price: " + price );
    }

}
